﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using java.lang;
using org.slf4j;

namespace Game
{
    public class GarbageCollector
    {
        static Logger _log = LoggerFactory.getLogger(typeof (GarbageCollector));
        static GarbageCollector()
        {
            ThreadPoolManager.getInstance().scheduleAtFixedRate(new GarbageCollectorTask(), Config.GARBAGE_COLLECTOR_INTERVAL, Config.GARBAGE_COLLECTOR_INTERVAL);
        }
        private class GarbageCollectorTask:Runnable
	    {
		   
		    public void run()
		    {
			    _log.info("GarbageCollector: start");
			    java.lang.System.gc();
                java.lang.System.runFinalization();
			    _log.info("GarbageCollector: finish");
		    }
	    }
    }
}
